<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
	prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
	prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
	prefix="logic"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
	<head>
		<title>JSP for SysTeamForm form</title>
		<LINK href="css/default.css" rel=stylesheet>
		<LINK href="css/button.css" rel=stylesheet>
		<script src="js/prototype.js"></script>
		<script language="javascript" type="text/javascript">
		function show(){
		id2.style.display='block';
		}
		function changeselect(obj){
		  if( obj=='id1')
		  {
		     if (id1.style.display=='none')
		        id1.style.display='block';
		     else
		        id1.style.display='none'; 
		        return;  
		  }

		  id2.style.display='none';
		  id3.style.display='none';
		  id4.style.display='none';
		  id5.style.display='none';
		  //id6.style.display='none';
		  if( obj!='id5'||execing.style.display=='none')
		     document.getElementById(obj).style.display='block';
		}
		function hide(){
		id2.style.display='none';
		}
		function opchange(o){
		document.campcampseqForm.method.value=o;
		document.campcampseqForm.submit();
		}
		function cancelsub(){
			hide();
		}
		function changecamp(sel){
		if(sel.value!="zz")
		window.location.href="campcampseq.do?method=list&campid="+sel.value;
		}
		
function geninfo()
{
$('id5').style.display="none";
$('execing').style.display="block";
var url = '/tcms/campcampseq.do';
var pars = 'method=geninfo&campid=<%=request.getParameter("campid")%>&campseqid=<%=request.getParameter("campseqid")%>';
var myAjax = new Ajax.Request(
url,
{
method: 'get',
parameters: pars,
onComplete: showResponse
});
}
function showResponse(originalRequest)
{
//put returned XML in the textarea
//$('result').value = originalRequest.responseText;
$('id5').style.display="block";
$('execing').style.display="none";
}
		</script>
	</head>
	<body>
		<html:form action="/campcampseq">
			<div id="id1">
				<table width="880" cellspacing="0" cellpadding="0" border="0"
					align="center">
					<tbody>
						<tr>
							<td width="3" height="31">
								<img height="31" src="./images/table_01.gif" width="3" />
							</td>
							<td background="./images/table_02.gif" height="31">
								<table cellspacing="0" cellpadding="0" width="146" align="left"
									border="0">
									<tbody>
										<tr>
											<td width="51" background="./images/title_1_bg.gif">
												<img height="31" src="./images/title_1.gif" width="51" />
											</td>
											<td width="95" background="./images/title_1_bg.gif">
												<span class="color_b_666">波次管理</span>
											</td>
										</tr>
									</tbody>
								</table>
							</td>
							<td width="3">
								<img height="31" src="./images/table_03.gif" width="3" />
							</td>
						</tr>
						<tr>
							<td width="3" background="./images/table_04.gif" width="3"
								align="right">
								<img height="100%" src="./images/table_04.gif" width="3" />
							</td>
							<td align="left">
								<div align="left">
									<bean:message key="campcampseq.jsp.allseg" />
									<select onchange="changecamp(this)">
										<option value="zz">
											选择一个营销活动
										</option>
										<logic:iterate name="campcamplist" id="ccl">
											<option value="${ccl.campId}"
												<logic:equal name="ccl" property="campId" value="${campid}">selected</logic:equal>>
												<bean:write name="ccl" property="campName" />
											</option>
										</logic:iterate>
									</select>
								</div>
								<logic:present name="campcampseqlist">
									<table width="850" border="0" align="center" cellpadding="5"
										cellspacing="1" bgcolor="#FF9900">
										<tr>
											<th>
												<bean:message key="campcampseq.jsp.campseqid" />
											</th>
											<th>
												<bean:message key="campcampseq.jsp.campName" />
											</th>
											<th>
												<bean:message key="campcampseq.jsp.campseqname" />
											</th>
											<th>
												<bean:message key="campcampseq.jsp.callerNum" />
											</th>
											<th>
												<bean:message key="campcampseq.jsp.targetCustNum" />
											</th>
											<th>
												<bean:message key="common.jsp.operation" />
												<html:link href="campcampseq.do?&campid=${campid}&method=list">
													<bean:message key="common.jsp.addlink" />
												</html:link>
											</th>
										</tr>
										<logic:iterate name="campcampseqlist" id="i"
											offset="startRowNo" length="pageSize">
											<tr bgcolor="ffffff">
												<td class="spec">
													<bean:write name="i" property="campSeqId" />
												</td>
												<td class="alt">
													<bean:write name="i" property="campId" />
												</td>
												<td>
													<bean:write name="i" property="campSeqName" />
												</td>
												<td class="alt">
													<bean:write name="i" property="callerNum" />
												</td>
												<td>
													<bean:write name="i" property="targetCustNum" />
												</td>
												<td class="alt">
													<html:link
														href="campcampseq.do?method=list&campid=${campid}&campseqid=${i.campSeqId}">
														<bean:message key="common.jsp.viewlink" />
													</html:link>
												</td>
											</tr>
										</logic:iterate>
										<tr>
											<td align="center" colspan="6">
												<div align="center" style="font-size: 12">
													<a
														href="campcampseq.do?method=list&paging=first&campid=${campid}">首页</a>
													<a
														href="campcampseq.do?method=list&paging=previous&campid=${campid}">上一页</a>
													<a
														href="campcampseq.do?method=list&paging=next&campid=${campid}">下一页</a>
													<a
														href="campcampseq.do?method=list&paging=last&campid=${campid}">尾页</a>
													&nbsp;&nbsp;&nbsp;&nbsp;
													<logic:present name="currPage">
					第<bean:write name="currPage" />/<bean:write name="maxPage" />页
										</logic:present>
												</div>
											</td>
										</tr>
									</table>
								</logic:present>

							</td>
							<td background="./images/table_05.gif" width="3" align="left">
								<img height="100%" src="./images/table_05.gif" width="3">
							</td>
						</tr>
						<tr>
							<td height=3 valign="top">
								<img height="12px" src="./images/table_06.gif" width="3px">
							</td>
							<td height=3 valign="top">
								<img height="3px" src="./images/table_07.gif" width="100%">
							</td>
							<td height=3 valign="top">
								<img height="12px" src="./images/table_08.gif" width="3px">
							</td>
						</tr>
					</tbody>
				</table>
			</div>
			<logic:present name="campcampseq">
				<div align="center" id="menu">
					<input class=btn_mouseout type="button"
						onmouseover="this.className=&#39;btn_mouseover&#39;"
						onmouseout="this.className=&#39;btn_mouseout&#39;"
						onmousedown="this.className=&#39;btn_mousedown&#39;"
						onmouseup="this.className=&#39;btn_mouseup&#39;"
						value="<bean:message key="common.jsp.showhidden" />"
						onclick="changeselect('id1')">
					<input class=btn_mouseout
						onmouseover="this.className=&#39;btn_mouseover&#39;"
						onmouseout="this.className=&#39;btn_mouseout&#39;"
						onmousedown="this.className=&#39;btn_mousedown&#39;"
						onmouseup="this.className=&#39;btn_mouseup&#39;" type="button"
						value="<bean:message key="campcampseq.jsp.campsegbaseinfo" />"
						onclick="changeselect('id2')">
					<input class=btn_mouseout
						onmouseover="this.className=&#39;btn_mouseover&#39;"
						onmouseout="this.className=&#39;btn_mouseout&#39;"
						onmousedown="this.className=&#39;btn_mousedown&#39;"
						onmouseup="this.className=&#39;btn_mouseup&#39;" type="button"
						value="<bean:message key="campcampseq.jsp.selectcaller" />"
						onclick="changeselect('id3')">
					<input type="button" class=btn_mouseout
						onmouseover="this.className=&#39;btn_mouseover&#39;"
						onmouseout="this.className=&#39;btn_mouseout&#39;"
						onmousedown="this.className=&#39;btn_mousedown&#39;"
						onmouseup="this.className=&#39;btn_mouseup&#39;"
						value="<bean:message key="campcampseq.jsp.divcallto" />"
						onclick="changeselect('id4')">
					<input type="button" class=btn_mouseout
						onmouseover="this.className=&#39;btn_mouseover&#39;"
						onmouseout="this.className=&#39;btn_mouseout&#39;"
						onmousedown="this.className=&#39;btn_mousedown&#39;"
						onmouseup="this.className=&#39;btn_mouseup&#39;"
						value="<bean:message key="campcampseq.jsp.geneinfo" />"
						onclick="changeselect('id5')">
				</div>
			</logic:present>
			<br>
			<br>

			<logic:present name="campcampseq">
				<div align="center" id="id2">
					<table width="880" cellspacing="0" cellpadding="0" border="0">
						<tbody>
							<tr>
								<td width="3" height="31">
									<img height="31" src="./images/table_01.gif" width="3" />
								</td>
								<td background="./images/table_02.gif" height="31">
									<table cellspacing="0" cellpadding="0" width="146" align="left"
										border="0">
										<tbody>
											<tr>
												<td width="51" background="./images/title_1_bg.gif">
													<img height="31" src="./images/title_1.gif" width="51" />
												</td>
												<td width="95" background="./images/title_1_bg.gif">
													<span class="color_b_666">波次信息</span>
												</td>
											</tr>
										</tbody>
									</table>
								</td>
								<td width="3">
									<img height="31" src="./images/table_03.gif" width="3" />
								</td>
							</tr>
							<tr>
								<td width="3" background="./images/table_04.gif" width="3"
									align="right">
									<img height="100%" src="./images/table_04.gif" width="3" />
								</td>
								<td>
									<table width="770" border="0" align="center" cellpadding="5"
										cellspacing="1" bgcolor="#FF9900">
										<tr>
											<th colspan="4">
												<bean:message key="campcampseq.jsp.message1.tip1" />
												<bean:write name="campcnt" />
												<bean:message key="campcampseq.jsp.message1.tip2" />
												<bean:write name="campusecnt" />
												<bean:message key="campcampseq.jsp.message1.tip3" />
												<b> <bean:write name="campcampseq"
														property="campSeqName" /> </b>
												<bean:message key="campcampseq.jsp.divcalltoname" />
												<bean:write name="campcampseq" property="targetCustNum" />
											</th>
										</tr>
										<tr>
											<td class="alt">
												<bean:message key="campcampseq.jsp.campid" />
											</td>
											<td>
												<html:text readonly="true" property="campcampseq.campId"
													value="${campcampseq.campId}" />
											</td>
											<td class="alt">
												<bean:message key="campcampseq.jsp.campseqid" />
											</td>
											<td>
												<html:text readonly="true" property="campcampseq.campSeqId"
													value="${campcampseq.campSeqId}" />
											</td>
										</tr>
										<tr>
											<td class="alt">
												<bean:message key="campcampseq.jsp.campseqname" />
											</td>
											<td>
												<html:text property="campcampseq.campSeqName"
													value="${campcampseq.campSeqName}" />
											</td>
											<td class="alt">
												<bean:message key="campcampseq.jsp.targetcustdesc" />
											</td>
											<td>
												<html:text property="campcampseq.targetCustNum"
													value="${campcampseq.targetCustNum}" />
												<html:errors property="targetcustdesc" />
											</td>
										</tr>
										<tr>
											<td class="alt">
												<bean:message key="campcampseq.jsp.callerNum" />
											</td>
											<td>
												<html:text property="campcampseq.callerNum"
													value="${campcampseq.callerNum}" />
											</td>
											<td class="alt">
												<bean:message key="campcampseq.jsp.isAllocateList" />
											</td>
											<td>
												<html:text readonly="true" property="campcampseq.isAllocateList"
													value="${campcampseq.isAllocateList}" />
											</td>
										</tr>
										<tr>
											<td class="alt">
												<bean:message key="campcampseq.jsp.isAppointStaff" />
											</td>
											<td>
												<html:text readonly="true" property="campcampseq.isAppointStaff"
													value="${campcampseq.isAppointStaff}" />
											</td>
											<td class="alt">
												<bean:message key="campcampseq.jsp.isCampStart" />
											</td>
											<td>
												<html:text readonly="true" property="campcampseq.isCampStart"
													value="${campcampseq.isCampStart}" />
											</td>
										</tr>
										<tr>
											<td class="alt">
												<bean:message key="campcampseq.jsp.remark" />
											</td>
											<td colspan="3" align="center">
												<html:textarea property="campcampseq.remark"
													value="${campcampseq.remark}" rows="5" cols="70" />
											</td>
										</tr>
										<tr>
											<td colspan="4" align="center" class="alt">
												<img src='images/button_modify.gif' width="63" height="21" onclick="opchange('save')" />
												&nbsp;&nbsp;
												<img src='images/button_delete.gif' width="63" height="21" onclick="opchange('delete')" />
												&nbsp;&nbsp;
												<img src='images/button_reset.gif' width="63" height="21" onclick="opchange('list')" />
											</td>
										<tr>
									</table>
								</td>
								<td background="./images/table_05.gif" width="3" align="left">
									<img height="100%" src="./images/table_05.gif" width="3">
								</td>
							</tr>
							<tr>
								<td height=3 valign="top">
									<img height="12px" src="./images/table_06.gif" width="3px">
								</td>
								<td height=3 valign="top">
									<img height="3px" src="./images/table_07.gif" width="100%">
								</td>
								<td height=3 valign="top">
									<img height="12px" src="./images/table_08.gif" width="3px">
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</logic:present>
			<logic:present name="campcampseqlist">
				<logic:notPresent name="campcampseq">
					<div align="center" id="id2">
						<table width='400' border="0" align="center" cellpadding="5" cellspacing="1"
							bgcolor="#FF9900">
							<tr>
								<th class="alt" colspan="2">
									<center>
										<bean:message key="campcampseq.jsp.addnew" />
									</center>
								</th>
							</tr>
							<tr>
								<td class="alt">
									<bean:message key="campcampseq.jsp.campid" />
								</td>
								<td>
									<html:text readonly="true" property="campcampseq.campId"
										value="${campid}" />
								</td>
							</tr>
							<tr>
								<td class="alt">
									<bean:message key="campcampseq.jsp.campseqname" />
								</td>
								<td>
									<html:text property="campcampseq.campSeqName"
										value="${campcampseq.campSeqName}" size="40"/>
								</td>
							</tr>
							<tr>
								<td class="spec" colspan="2" align="center">
									<img src='images/button_addnew.gif' width="63" height="21" onclick="opchange('save')" />
									&nbsp;&nbsp;
									<img src='images/button_cancel.gif' width="63" height="21" onclick="hide()" />
								</td>
							</tr>
						</table>
					</div>
				</logic:notPresent>
			</logic:present>
			<div align="center" id="id3" style="display: none">
				<logic:present name="campcampseq">
					<logic:greaterThan name="campcampseq" property="targetCustNum"
						value="0">
						<table width="770" border="0" align="center" cellpadding="5"
							cellspacing="1" bgcolor="#FF9900">
							<logic:present name="sysuserlist">
								<%
									int i = 0;
									int j = 0;
								%>
								<logic:iterate name="sysuserlist" id="sul">
									<%
											i = 0;
											if (j == 0) {
												out.print("<tr>");
											}
									%>
									<td>
										<logic:present name="sequserlist">
											<logic:iterate name="sequserlist" id="seul">
												<logic:equal name="seul" property="userId"
													value="${sul.userId}">
													<%
													i = 1;
													%>
												</logic:equal>
											</logic:iterate>
										</logic:present>
										<input type="checkbox" id="empappds" name="empappds"
											value="<bean:write name="sul" property="userId" />"
											<%=(1 == i ? "checked" : "")%> />
										<bean:write name="sul" property="userName" />
									</td>
									<%
											j = (j + 1) % 6;
											if (j == 0) {
												out.print("</tr>");
											}
									%>
								</logic:iterate>
								<%
										for (; j < 6; j++)
										out.print("<td>&nbsp;</td>");
								%>
							</logic:present>
							<tr>
								<td colspan=6 align="center">
									<img src='images/button_true.gif' width="63" height="21" onclick="opchange('appd')" />
									&nbsp;&nbsp;
									<img src='images/button_cancel.gif' width="63" height="21" onclick="opchange('list')" />
								</td>
							</tr>
						</table>
					</logic:greaterThan>
					<logic:lessEqual name="campcampseq" property="targetCustNum"
						value="0">
						<table border="0" align="center" cellpadding="5" cellspacing="1"
							bgcolor="#FF9900">
							<tr>
								<th>
									提示信息
								</th>
							</tr>
							<tr>
								<td>
									<img src="images/waihu0.png">
								</td>
							</tr>
						</table>
					</logic:lessEqual>
				</logic:present>

			</div>

			<div align="center" id="id4" style="display: none">
				<logic:present name="campcampseq">
					<logic:greaterThan name="campcampseq" property="targetCustNum"
						value="0">
						<logic:equal name="campcampseq" property="isAppointStaff"
							value="Y ">
							<table width="770" border="0" align="center" cellpadding="5"
								cellspacing="1" bgcolor="#FF9900">
								<logic:present name="sequserlist">

									<logic:iterate name="sequserlist" id="seul">
										<tr>
											<td>
												<html:hidden property="anid" value="${seul.userId}" />
												将为
												<bean:write name="seul" property="userName"></bean:write>
												分配
												<input type="text" name="annum" value="${seul.userCustNum}" />
												外呼名单
												<center>
								<a href="comm/geninfocache.jsp?campid=<bean:write name="campid" />&campseqid=<bean:write name="campcampseq" property="campSeqId" />" >生成外呼缓存信息 </a>
							               </center>
											</td>
										</tr>
									</logic:iterate>
									<b><font color="FF0000"><html:errors
												property="numtoomany" /> </font> </b>
								</logic:present>
								<tr>
									<td align="center">
										<img src='images/button_true.gif' width="63" height="21" onclick="opchange('numb')" />
										&nbsp;&nbsp;
										<img src='images/button_cancel.gif' width="63" height="21" onclick="opchange('list')" />
									</td>
								</tr>
							</table>
						</logic:equal>
						<logic:notEqual name="campcampseq" property="isAppointStaff"
							value="Y ">
							<table border="0" align="center" cellpadding="5" cellspacing="1"
								bgcolor="#FF9900">
								<tr>
									<th>
										提示信息
									</th>
								</tr>
								<tr>
									<td>
										<img src="images/zhidingrenyuan.png">
									</td>
								</tr>
							</table>
						</logic:notEqual>
					</logic:greaterThan>
					<logic:lessEqual name="campcampseq" property="targetCustNum"
						value="0">
						<table border="0" align="center" cellpadding="5" cellspacing="1"
							bgcolor="#FF9900">
							<tr>
								<th>
									提示信息
								</th>
							</tr>
							<tr>
								<td>
									<img src="images/mdsm.png">
								</td>
							</tr>
						</table>
					</logic:lessEqual>
				</logic:present>
			</div>

			<div align="center" id="id5" style="display: none">

				<logic:present name="campcampseq">
					<logic:equal name="campcampseq" property="isAppointStaff" value="Y ">
						<logic:equal name="campcampseq" property="isAllocateList"
							value="Y ">
							<bean:message key="campcampseq.jsp.message2" />
							<br />
							<center>
								<input type="button"
									value="<bean:message key="campcampseq.jsp.clicktogeneinfo"/>"
									onclick="geninfo()">
								<input type="button"
									value="<bean:message key="common.jsp.reset" />"
									onclick="opchange('list')">
							</center>
							
							<center>
								<a href="comm/geninfocache.jsp?campid=<bean:write name="campid" />&campseqid=<bean:write name="campcampseq" property="campSeqId" />" >生成外呼缓存信息 </a>
							</center>
						</logic:equal>
						<logic:notEqual name="campcampseq" property="isAllocateList"
							value="Y ">
							<table border="0" align="center" cellpadding="5" cellspacing="1"
								bgcolor="#FF9900">
								<tr>
									<th>
										提示信息
									</th>
								</tr>
								<tr>
									<td>
										<img src="images/wfp.png">
									</td>
								</tr>
							</table>
						</logic:notEqual>
					</logic:equal>
					<logic:notEqual name="campcampseq" property="isAppointStaff"
						value="Y ">
						<table border="0" align="center" cellpadding="5" cellspacing="1"
							bgcolor="#FF9900">
							<tr>
								<th>
									提示信息
								</th>
							</tr>
							<tr>
								<td>
									<img src="images/wzd.png">
								</td>
							</tr>
						</table>
					</logic:notEqual>
				</logic:present>
			</div>
			<center>
				<div align="center" class="tip" id="execing" style="display: none">
					<br />
					<img src="images/execing.gif" />
					正在生成数据，请耐心等待....
				</div>
			</center>

			<div align="center" id="commit">
				<html:hidden property="method" value="save" />
				<html:hidden property="campid" value="${campid}" />
				<html:hidden property="campseqid" value="${campcampseq.campSeqId}" />
			</div>
		</html:form>
	</body>
</html>

